White Box Testing (WBT):
	
   It is type of testing done by the dev to verify the source code. 
   To perform this type of testing we need to have understanding of complete requirements and as well as complete code knowledge.
   It is also k.a, Glass Box Testing OR Unit Testing.

Usually WBT will be performed by Dev. QA can also perform WBT provided they should have proper coding knowledge.


Structure-based OR white box techniques:

Definition:
Structure-based (or White-box) testing focuses on verifying the internal structure or logic of the code. Unlike black-box techniques, this approach requires knowledge of how the software is implemented (Coding Skills).

Use Case:
These techniques are typically used during unit testing or component testing, often performed by developers but also by technically skilled testers.


Key Techniques:
1. Statement Coverage
Definition: Ensures that each line of code (statement) is executed at least once during testing.

Goal: To verify that all executable statements in the code have been tested.

Example: most basic form of code coverage.

if (x > 10) {
    System.out.println("x is greater than 10");
}
System.out.println("End of check");


Test input should trigger both the if condition and the line after the if.



2. Decision Coverage (Branch Coverage)
Definition: Ensures every possible decision (true/false) in the code is executed.

Goal: To test all branches from every decision point.

Example: not all branches may be covered with just statement tests.

if (x > 10) {
    // true branch
} else {
    // false branch
}
Needs at least two tests: one where x > 10, and one where it isn't.




3. Condition Coverage
Definition: Tests each individual condition in a decision to evaluate both true and false outcomes.

Example: multiple logical conditions are used in a single decision.

if (x > 10 && y < 5) {
    // do something
}
Each condition x > 10 and y < 5 should be tested independently for true and false.



4. Multiple Condition Coverage
Definition: Evaluates all possible combinations of conditions in a decision.

Goal: To test combinations of condition outcomes (e.g., TT, TF, FT, FF).

Example: complex quickly with more conditions.

if (x > 10 && y < 5) { ... }
Requires 4 test cases to cover all possible combinations of the two conditions.


5. All Path Coverage Testing (different inputs can lead to different code paths.)
Definition: Ensures every possible path through the code is executed.

Goal: To catch edge cases and rare execution paths.

Use Case: Most thorough but expensive; often used in safety-critical systems (e.g., aviation, healthcare).

Summary:
Technique: Statement Coverage
Coverage Type: Line-by-line
Complexity: Low
Best For: Unit testing basics
---------------------------------
Technique: Decision Coverage
Coverage Type: Branch decisions
Complexity: Medium
Best For: Ensuring logic decisions work
---------------------------------
Technique: Condition Coverage
Coverage Type: Boolean conditions
Complexity: Medium
Best For: Testing logical conditions
---------------------------------
Technique: Multiple Condition Coverage
Coverage Type: Condition combos
Complexity: High
Best For: Critical systems logic testing
---------------------------------
Technique: All Path Coverage
Coverage Type: Every code path
Complexity: Very High
Best For: High-risk or regulatory software
